//
//  CinemaListCell.m
//  UI_豆瓣
//
//  Created by WangZe on 15/10/12.
//  Copyright © 2015年 王泽龙. All rights reserved.
//

#import "CinemaListCell.h"

@implementation CinemaListCell
- (void)dealloc
{
    [_myView release];
    [_upLabel release];
    [_centerLabel release];
    [_downLabel release];
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatView];
    }
    return self;
}
- (void)creatView
{
    self.myView = [[UIView alloc] init];
    [self.contentView addSubview:self.myView];
    
    self.myView.layer.cornerRadius = 10;
    self.myView.backgroundColor = [UIColor colorWithRed:196 / 255.0 green:215 / 255.0 blue:223 / 255.0 alpha:1];
    [_myView release];
    
    self.upLabel = [[UILabel alloc] init];
    [self.myView addSubview:self.upLabel];
    self.upLabel.font = [UIFont systemFontOfSize:24];
    [_upLabel release];
    
    self.centerLabel = [[UILabel alloc] init];
    [self.myView addSubview:self.centerLabel];
    self.centerLabel.numberOfLines = 0;
    self.centerLabel.font = [UIFont systemFontOfSize:14];
    
    [_centerLabel release];
    
    self.downLabel = [[UILabel alloc] init];
    [self.myView addSubview:self.downLabel];
    self.downLabel.font = [UIFont systemFontOfSize:14];
    
    [_downLabel release];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.myView.frame = CGRectMake(10, 15, self.contentView.frame.size.width - 25, self.contentView.frame.size.height - 15);
    self.upLabel.frame = CGRectMake(5, 5, self.myView.frame.size.width - 5, self.myView.frame.size.height / 3 - 5);
    self.centerLabel.frame = CGRectMake(5, self.myView.frame.size.height / 3 + 5, self.myView.frame.size.width - 5, self.myView.frame.size.height / 3 - 5);
    self.downLabel.frame = CGRectMake(5, self.myView.frame.size.height / 3 * 2 + 5, self.myView.frame.size.width - 5, self.myView.frame.size.height / 3 - 5);
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
